function verifValidLog(){
    var email = $('input#email').val();
    var mdp = $('input#pass').val();
    
    $.ajax({
        url: site_url+"account/process",
        type: "POST",
        async:false,
        dataType: 'json',
        data: {
            email:email,
            mdp:mdp
        },
        success: function(e){
             if(e.result=='success') {
                 $(location).attr('href', site_url);
             } else {
                 $('span.error').html(e.msg);
                 $('span.error').slideDown();                 
             }
        }
    });
}

$(document).ready(function() {
    
    // Vérifie la validité des logins
    $('#submit_login').on('click', function(e){
        e.preventDefault();
        verifValidLog();
    });
    
});